package org.gbis.openbus.log;

import org.gbis.openbus.db.*;
import org.gbis.openbus.webbean.LogInfo;

public class LogManager {

	public DbManagerLogInfo getDbManager() {
		if( this.dbManager == null ) {
			this.dbManager = DbManagerLogInfo.getDbManager();
		}
		return this.dbManager;
	}

	public void setDbManager(DbManagerLogInfo dbManager) {
		this.dbManager = dbManager;
	}

	public void setWrite( LogInfo logInfo ) throws Exception {

		DbManager dbManager = this.getDbManager();

		dbManager.getUpdateResult( true, logInfo.getSearchParams() );

		dbManager.commit( true );
	}

	private LogManager() {

	}

	public static LogManager getLogManager() {
		return logManager;
	}

	private DbManagerLogInfo dbManager ;

	private static final LogManager logManager = new LogManager();

}
